﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:dna="http://www.dotnetage.com/XML/Schema/widget"
           attributeFormDefault="unqualified" elementFormDefault="qualified"
           targetNamespace="http://www.w3.org/ns/widgets"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://www.dotnetage.com/XML/Schema/widget" />
  <xs:element name="widget">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="author" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="href" type="xs:string" use="required" />
                <xs:attribute name="email" type="xs:string" use="required" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"/>
        <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
        <xs:element maxOccurs="unbounded" minOccurs="0" name="icon">
          <xs:complexType>
            <xs:attribute name="src" type="xs:string" use="required" />
            <xs:attribute name="width" type="xs:unsignedByte" use="optional" />
            <xs:attribute name="height" type="xs:unsignedByte" use="optional" />
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="unbounded" name="license" minOccurs="0" >
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="href" type="xs:string" use="optional" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element ref="dna:defaults"  minOccurs="0" maxOccurs="1"></xs:element>
        <xs:element name="feature" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="param">
                <xs:complexType>
                  <xs:attribute name="name" type="xs:string" use="required" />
                  <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="required" type="xs:boolean" default="false" />
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="unbounded" name="preference" minOccurs="0">
          <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="type" type="xs:string" use="required" />
            <xs:attribute name="readonly" type="xs:boolean" use="optional" default="false" />
            <xs:attribute name="value" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
        <xs:element name="content" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="type" type="xs:string" use="optional" default="text/html" />
                <xs:attribute name="src" type="xs:string" use="optional" />
                <xs:attribute name="encoding" type="xs:string" use="optional" default="UTF-8" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="id" type="xs:string" use="optional" />
      <xs:attribute name="version" type="xs:string" use="optional" default="1.0.0" />
    </xs:complexType>
  </xs:element>
</xs:schema>